Hello, |
Re: concatenate object Text with rtf There are several examples in the forum for concatenating richText. Use the search to find code examples. Hope this helps, regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: concatenate object Text with rtf Mathias Mamsch - Wed Sep 12 05:55:07 EDT 2012 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS In fact the solution was strangely simple...Indeed i had just to concatenate the richtext extracted from the object text and put it in my new object. I think i had errors in manipulation between string and richtexts extracts. So i have just to do a thing like: string s1 = richText o1."Object Text" string s2 = richText o2."Object Text" string s3 = richText s1 "\\par" s2 myNewObject."Object Text" richText s3 Thank you for your help! |
Re: concatenate object Text with rtf thomas.abdoul - Wed Sep 12 09:20:39 EDT 2012
bufTemp = richTextWithOle(o1."Object Text") bufTemp += "\\par " bufTemp += richTextWithOle(o2."Object Text") myNewObject."Object Text" = richText(tempStringOf(bufTemp)) delete(bufTemp) -Louie |
Re: concatenate object Text with rtf llandale - Wed Sep 12 14:10:59 EDT 2012
bufTemp = richTextWithOle(o1."Object Text") bufTemp += "\\par " bufTemp += richTextWithOle(o2."Object Text") myNewObject."Object Text" = richText(tempStringOf(bufTemp)) delete(bufTemp) -Louie
Lets do that right, shall we? ;-) Buffer bufResult = create() Buffer bufTemp = create() bufResult = richTextWithOle(o1."Object Text") bufResult += "\\par " bufTemp = richTextWithOle(o2."Object Text") combine(bufResult, bufTemp, 0) myNewObject."Object Text" = richText bufResult delete bufTemp delete bufResult
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: concatenate object Text with rtf Mathias Mamsch - Wed Sep 12 17:17:01 EDT 2012
Lets do that right, shall we? ;-) Buffer bufResult = create() Buffer bufTemp = create() bufResult = richTextWithOle(o1."Object Text") bufResult += "\\par " bufTemp = richTextWithOle(o2."Object Text") combine(bufResult, bufTemp, 0) myNewObject."Object Text" = richText bufResult delete bufTemp delete bufResult
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: concatenate object Text with rtf Mathias Mamsch - Wed Sep 12 17:17:01 EDT 2012
Lets do that right, shall we? ;-) Buffer bufResult = create() Buffer bufTemp = create() bufResult = richTextWithOle(o1."Object Text") bufResult += "\\par " bufTemp = richTextWithOle(o2."Object Text") combine(bufResult, bufTemp, 0) myNewObject."Object Text" = richText bufResult delete bufTemp delete bufResult
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Really? The DXL help lists three append operators for Buffers: Buffer b += string s Buffer b += char c Buffer b += Buffer b and so far I thought appending a Buffer would be safe, memory-wise. Is that not the case? Cheers, Peter |
Re: concatenate object Text with rtf Peter_Albert - Fri Sep 14 03:30:38 EDT 2012
Sorry I stand corrected. I just tested it and #include <src/test/core/petools.inc> #include <src/test/core/stringTable.inc> print "Start of the program: \n" printStringTable(); print "\n" Buffer buf = create() Buffer buf2 = create() print "After Creating Buffers: \n" printStringTable(); print "\n" buf += "Hello" print "After Adding a String using +=\n" printStringTable(); print "\n" buf2 = "World!" buf += buf2 print "After Adding a Buffer using +=\n" printStringTable(); print "\n" buf2 = "ORLY?!" buf2 += "YARLY!1" buf += tempStringOf buf2 print "After Adding a Buffer using += tempStringOf\n" printStringTable(); print "\n" buf2 = "ZOMFG!" buf2 += "WHUD?" buf += stringOf buf2 print "After Adding a Buffer using += stringOf\n" printStringTable(); print "\n"
Start of the program: Count = 16732 Clashes = 2456 After Creating Buffers: Count = 16732 Clashes = 2456 After Adding a String using += Count = 16732 Clashes = 2456 After Adding a Buffer using += Count = 16732 Clashes = 2456 After Adding a Buffer using += tempStringOf Count = 16732 Clashes = 2456 After Adding a Buffer using += stringOf Count = 16733 Clashes = 2457
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: concatenate object Text with rtf Mathias Mamsch - Fri Sep 14 05:39:55 EDT 2012
Sorry I stand corrected. I just tested it and #include <src/test/core/petools.inc> #include <src/test/core/stringTable.inc> print "Start of the program: \n" printStringTable(); print "\n" Buffer buf = create() Buffer buf2 = create() print "After Creating Buffers: \n" printStringTable(); print "\n" buf += "Hello" print "After Adding a String using +=\n" printStringTable(); print "\n" buf2 = "World!" buf += buf2 print "After Adding a Buffer using +=\n" printStringTable(); print "\n" buf2 = "ORLY?!" buf2 += "YARLY!1" buf += tempStringOf buf2 print "After Adding a Buffer using += tempStringOf\n" printStringTable(); print "\n" buf2 = "ZOMFG!" buf2 += "WHUD?" buf += stringOf buf2 print "After Adding a Buffer using += stringOf\n" printStringTable(); print "\n"
Start of the program: Count = 16732 Clashes = 2456 After Creating Buffers: Count = 16732 Clashes = 2456 After Adding a String using += Count = 16732 Clashes = 2456 After Adding a Buffer using += Count = 16732 Clashes = 2456 After Adding a Buffer using += tempStringOf Count = 16732 Clashes = 2456 After Adding a Buffer using += stringOf Count = 16733 Clashes = 2457
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
I am :-) |
Re: concatenate object Text with rtf Peter_Albert - Fri Sep 14 06:28:09 EDT 2012 Have fun, Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: concatenate object Text with rtf Mathias Mamsch - Wed Sep 12 17:17:01 EDT 2012
Lets do that right, shall we? ;-) Buffer bufResult = create() Buffer bufTemp = create() bufResult = richTextWithOle(o1."Object Text") bufResult += "\\par " bufTemp = richTextWithOle(o2."Object Text") combine(bufResult, bufTemp, 0) myNewObject."Object Text" = richText bufResult delete bufTemp delete bufResult
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Coming back to this older thread... I wanted to do something similar, but output rich text to the clipboard. For some reason, it seems to loose the bullets from my objects (even when I explicitly tried adding "true,true" to end of setRichClip). Other RTF formatting comes out OK (e.g. italics, bold, and indenting level). Any ideas on how to fix? (I don't know anything about font tables, so the example code just uses something from a DXL help example.)
void appendOLEoTxt(Object o,Buffer b)
{
Buffer bTmp=create()
bTmp = richTextWithOle(o."Object Text")
b += "\\par "
combine(b,bTmp,0)
delete bTmp
}
Object o81=object(81,current Module)
Object o83=object(83,current Module)
Object o93=object(93,current Module)
Buffer bufResult = create()
bufResult = richTextWithOle(o81."Object Text")
appendOLEoTxt(o83,bufResult)
appendOLEoTxt(o93,bufResult)
string fontTable = "\\deff0{\\fonttbl {\\f1 Times New Roman;}}"
setRichClip(bufResult,"Normal",fontTable)
delete bufResult
|